package com.cy.pj.sys.dao;

import com.cy.pj.sys.entity.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysUserDao {
    int getRowCount(String username);
    List<SysUser> findPageObjects(
           String  username,
            Integer startIndex,
           Integer pageSize);

    /*基于用户名进行分页查询（底层基于PageHelper去实现）*/
//    List<SysUser> findPageObjects(String username);

    //用户禁用启用
    int validById(
            @Param("id")Integer id,
            @Param("valid")Integer valid,
            @Param("modifiedUser")String modifiedUser);

    int insertObject(SysUser entity);

    SysUser findObjectById(Integer id);

    int updateObject(SysUser entity);

    int updatePassword(
            @Param("password")String password,
            @Param("salt")String salt,
            @Param("id")Integer id);

    //登录认证
    SysUser findUserByUserName(String username);

}
